package com.haier.spark.project.spark

class CategorySort(var clickCount:Long, var orderCount: Long, var payCount: Long) extends Ordered[CategorySort] with Serializable {
  override def compare(that: CategorySort): Int = {
    if (clickCount - that.clickCount != 0) {
      (clickCount - that.clickCount).toInt
    } else if (orderCount - that.orderCount != 0) {
      (orderCount - that.orderCount).toInt
    } else if (payCount - that.payCount != 0) {
      (payCount - that.payCount).toInt
    } else {
      0
    }
  }
}
